Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call report if LCP occurs before first hidden #197

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

monis0395
Copy link
Contributor

Report LCP only if the value changes. To keep things consistent with other metrics

@monis0395
Copy link
Contributor Author

This will resolve part 2 of #193

@philipwalton philipwalton merged commit 9dd5fd2 into GoogleChrome:main Jan 6, 2022
@philipwalton philipwalton changed the title Report LCP only if the value changes Only call report if LCP occurs before first hidden Jan 6, 2022
@philipwalton
Copy link
Member

Thanks! Note to anyone reading this that this change doesn't affect the behavior of the library or what will be reported.

Before this change, when the report() function was called unconditionally it would not actually invoke the onReport callback in cases where the document was hidden because no LCP value would be set on the metric. This change just makes the code for LCP consistent with other metrics (e.g. FCP and FID).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants